package com.jiinfo.controller;

import java.text.DateFormat;
import java.text.SimpleDateFormat;

import com.jfinal.kit.PropKit;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;
import com.jiinfo.base.BaseController;
import com.jiinfo.util.CheckUserUtil;

public class ApiController extends BaseController{

	
	private String pUrl=PropKit.get("project.url");
	
	private DateFormat mDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm");
	private Record getBoothByToken(String token){
		if(CheckUserUtil.isValid(token)){
			String id=CheckUserUtil.getUsername(token);
			return Db.findById("t_booth", id);
		}
		return null;
	}
	
	private Record getAdminByToken(String token){
		if(CheckUserUtil.isValid(token)){
			String id=CheckUserUtil.getUsername(token);
			return Db.findById("t_user", id);
		}
		return null;
	}
	
}
